import time
from selenium.webdriver.common.by import By
from base.mis.base import BasePage, BaseHandle
class HomePage(BasePage):
    def __init__(self):
        super().__init__()
        self.quit_info=By.XPATH,'//*[@id="app"]/div/div[1]/a[2]'
        self.content_manage=By.XPATH,'//*[@id="app"]/div/div[2]/ul/li[2]/a'
        self.content_audit=By.XPATH,'//*[@id="app"]/div/div[2]/ul/li[2]/ul/li/a'
    def find_quit_info(self):
        return self.get_element(self.quit_info)
    def find_content_manage(self):
        return self.get_element(self.content_manage)
    def find_content_audit(self):
        return self.get_element(self.content_audit)
class HomeHandle(BaseHandle):
    def __init__(self):
        self.home_page=HomePage()
    def get_quit_info(self):
        return self.home_page.find_quit_info().text
    def click_content_manage(self):
        self.home_page.find_content_manage().click()
    def click_content_audit(self):
        self.home_page.find_content_audit().click()
class HomeProxy:
    def __init__(self):
        self.home_page_handle=HomeHandle()
    def get_quit(self):
        return self.home_page_handle.get_quit_info()
    def go_content_audit(self):
        self.home_page_handle.click_content_manage()
        time.sleep(1)
        self.home_page_handle.click_content_audit()
